package com.flyco.modules.stm.entity;

import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.flyco.poi.excel.annotation.Excel;

/**
 * @Description: 业务和出入库关联表
 * @Author: flyco
 * @Date:   2022-11-29
 * @Version: V1.0
 */
@Data
@TableName("stm_retreat")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="stm_retreat对象", description="业务和出入库关联表")
public class StmRetreat {
    
	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
	private Long id;
	/**商家id*/
	@Excel(name = "商家id", width = 15)
    @ApiModelProperty(value = "商家id")
	private Long partnerId;
	/**店铺id*/
	@Excel(name = "店铺id", width = 15)
    @ApiModelProperty(value = "店铺id")
	private Long storeId;
	/**店铺名称*/
	@Excel(name = "店铺名称", width = 15)
    @ApiModelProperty(value = "店铺名称")
	private String storeName;
	/**退仓单编号*/
	@Excel(name = "退仓单编号", width = 15)
    @ApiModelProperty(value = "退仓单编号")
	private String retreatSn;
	/**订单状态(0：已创建，1：已提交，3：已审核，4:已取消，7：已完成)*/
	@Excel(name = "订单状态(0：已创建，1：已提交，3：已审核，4:已取消，7：已完成)", width = 15)
    @ApiModelProperty(value = "订单状态(0：已创建，1：已提交，3：已审核，4:已取消，7：已完成)")
	private Integer status;
	/**创建人id*/
	@Excel(name = "创建人id", width = 15)
    @ApiModelProperty(value = "创建人id")
	private Long createSalesId;
	/**创建人*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
	private String createSales;
	/**审核ID*/
	@Excel(name = "审核ID", width = 15)
    @ApiModelProperty(value = "审核ID")
	private Long confirmSalesId;
	/**审核人*/
	@Excel(name = "审核人", width = 15)
    @ApiModelProperty(value = "审核人")
	private String confirmSales;
	/**审核通过时间*/
	@Excel(name = "审核通过时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审核通过时间")
	private Date confirmTime;
	/**取消人ID*/
	@Excel(name = "取消人ID", width = 15)
    @ApiModelProperty(value = "取消人ID")
	private Long cancelSalesId;

	private String sapAddressCode;

	/**取消人*/
	@Excel(name = "取消人", width = 15)
    @ApiModelProperty(value = "取消人")
	private String cancelSales;
	/**取消时间*/
	@Excel(name = "取消时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "取消时间")
	private Date cancelTime;

	private Integer version;

	/**创建人*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**更新人*/
	@Excel(name = "更新人", width = 15)
    @ApiModelProperty(value = "更新人")
	private String updateBy;
	/**更新时间*/
	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
	private Date updateTime;

	@TableField(exist = false)
	private String status_dictText;

	//0：已创建，1：已提交，3：已审核，4:已取消，7：已完成
	public void setStatusDictText() {
		switch(status){
			case 1:
				status_dictText =  "待推送";
				return;
			case 4:
				status_dictText = "已取消";
				return;
			case 3:
				status_dictText = "待确认";
				return;
			case 5:
				status_dictText = "待发货";
				return;
			case 7:
				status_dictText = "已完成";
				return;
			default:
				status_dictText = "未知状态"+status;
		}
	}

	/**店铺名称*/
	@TableField(exist = false)
	private String storeId_dictText;
}
